package com.gm.nanopct3;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;

import com.gm.nanopct3.test.TestActivity;
import com.gm.nanopct3.test.TestContext;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class MainActivity extends AppCompatActivity {


    @Bind(R.id.test_buzzer)
    Button testBuzzer;
    @Bind(R.id.test_led)
    Button testLed;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        ButterKnife.bind(this);


    }

    @OnClick({R.id.test_buzzer, R.id.test_led})
    public void onViewClicked(View view) {

        switch (view.getId()) {
            case R.id.test_buzzer:
                Intent intent = new Intent(TestContext.ACTION_TEST_BUZZER);
                intent.setPackage(getPackageName());
                startActivity(intent);
                break;
            case R.id.test_led:
                startActivity(new Intent(MainActivity.this, TestActivity.class));
                break;
        }
    }



  /*  private void init() {
        button = (Button) findViewById(R.id.button);
        button2 = (Button) findViewById(R.id.button2);
        button3 = (Button) findViewById(R.id.button3);
        button4 = (Button) findViewById(R.id.button4);

        button.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                System.out.println("exp");
                HardwareControler.exportGPIOPin(GPIO_PIN);
            }
        });
        button2.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                System.out.println("out");
                HardwareControler.setGPIODirection(GPIO_PIN, GPIOEnum.OUT);
            }
        });
        button3.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                System.out.println("high");
                HardwareControler.setGPIOValue(GPIO_PIN, GPIOEnum.HIGH);
            }
        });
        button4.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                System.out.println("low");
                HardwareControler.setGPIOValue(GPIO_PIN, GPIOEnum.LOW);

            }
        });
    }*/


}
